package com.zn.listener;


import com.zn.asycn.UploadWatermark;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 订阅到redis消息
 */
@Component
public class RedisReceiver {
    private static final Logger LOGGER = LoggerFactory.getLogger(RedisReceiver.class);
    @Autowired
    private UploadWatermark uploadWatermark;

    /**
     * 根据CRM推送过来的 agreementId 进行客户图片更改
     * @param agreementId
     */
    public void updateAgreementPicNotify(String agreementId) {
        try {
            LOGGER.info("updateAgreementPicNotify info-------->"+agreementId);
            Thread.sleep(5000);
            uploadWatermark.updateCustomerWatermark(agreementId);
        }catch (Exception e){
            LOGGER.error("updateAgreementPicNotify Exception.......",e);
        }
    }

}